//@ts-ignore
import request from '@/utils/request';
//@ts-ignore
import {
  MyOrderListRequestData,
  ResponseData,
  AddOrderRequestData,
  DelateOrderRequestData,
  MerOrderListRequestData,
  UpdateOrderRequestData
} from "@/api/order/type";

/**
 * 订单接口集合
 */
enum API {
  MYORDER_LIST_URL = '/order/mylist',
  MERORDER_LIST_URL = '/order/merlist',
  ADDORDER_URL = '/order/add',
  DELATEORDER_URL = '/order/delete',
  UPDATEORDER_URL = '/order/update',
}

export const reqMyOrderList = (data: MyOrderListRequestData) =>
    request.post<any, ResponseData>(API.MYORDER_LIST_URL, data)

export const reqMerOrderList = (data: MerOrderListRequestData) =>
    request.post<any, ResponseData>(API.MERORDER_LIST_URL, data)

export const reqAddOrder = (data: AddOrderRequestData) =>
    request.post<any, ResponseData>(API.ADDORDER_URL, data)

export const reqDelateOrder = (data: DelateOrderRequestData) =>
    request.post<any, ResponseData>(API.DELATEORDER_URL, data)

export const reqUpdateOrder = (data: UpdateOrderRequestData) =>
    request.post<any, ResponseData>(API.UPDATEORDER_URL, data)




